// 基本信息
<template>
  <Form :model="formItem" :label-width="110">
    <FormItem label="修改密码">
      <Input type="password" v-model="formItem.newPass" placeholder="原始面膜"></Input>
      <Input type="password" v-model="formItem.newsPass" placeholder="新密码"></Input>
    </FormItem>

    <FormItem>
      <Button type="primary" @click.stop="changePassword">修改</Button>
      <Button style="margin-left: 8px">取消</Button>
    </FormItem>
  </Form>
</template>

<script type="text/ecmascript-6">
export default {
  data() {
    return {
      formItem: {}
    };
  },
  created() {
    // this.getShopInfo();
  },
  methods: {
    changePassword: function() {
      let _self = this
      let user = JSON.parse(localStorage.getItem("userinfo"));
      console.log(user);
      $.ajax({
        url: BASE_URL + "users/editPassword",
        type: "post",
        data: {
          id: user.id,
          oldPassword: _self.formItem.newPass,
          newPassword: _self.formItem.newsPass
        },
        success: function(data) {
          console.log(data)
          if(data){
  _self.$Message.info("修改成功");
 _self.formItem.newPass=""
 _self.formItem.newsPass=""
          }else{
            _self.$Message.info('失败')
          }
        }
      });
    }
  }
};
</script>

<style scoped >
</style>
